package com.yjz.jvm.对象头;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

public class MarkWordAnalysis {
    public static void main(String[] args) {
        Object obj = new Object();
        System.out.println(ClassLayout.parseInstance(obj).toPrintable());

        // 手动解析 Mark Word
        long markWord = VM.current().addressOf(obj);
        System.out.println("Mark Word (hex): " + Long.toHexString(markWord));
    }
}